<?php


use p5\objects\SqlMaker;
use p5\objects\TimeUtils;

function format_date($d)
{
    return TimeUtils::format_date($d);
}

function format_time($d)
{
    return TimeUtils::format_time($d);
}

function get_milli_time()
{
    return TimeUtils::get_milli_time();
}

function current_date()
{
    return TimeUtils::current_date();
}

function yesterday()
{
    return TimeUtils::yesterday();
}

function offset_n_day($n)
{
    return TimeUtils::offset_n_day($n);
}

function tomorrow()
{
    return TimeUtils::tomorrow();
}

function current_time()
{
    return TimeUtils::current_time();
}

function time_add($time, $offset, $unit = 'minute')
{
    return TimeUtils::time_add($time, $offset, $unit);
}

function time_offset($time, $offset, $unit = "minute")
{
    return TimeUtils::time_offset($time, $offset, $unit);
}

//获得下周的第一天
function get_next_week_begin()
{
    return TimeUtils::get_next_week_begin();
}


function string_to_date($string)
{
    return TimeUtils::string_to_date($string);
}

function is_today($time)
{
    return TimeUtils::is_today($time);
}

function is_yesterday($time)
{
    return TimeUtils::is_yesterday($time);
}

function is_this_week($time)
{
    return TimeUtils::is_this_week($time);
}

function is_last_week($time)
{
    return TimeUtils::is_last_week($time);
}

function is_last_7_day($time)
{
    return TimeUtils::is_last_7_day($time);
}

function is_last_30_day($time)
{
    return TimeUtils::is_last_30_day($time);
}

function check_day_offset($time, $days)
{
    return TimeUtils::check_day_offset($time, $days);
}

function is_this_month($time)
{
    return TimeUtils::is_this_month($time);
}

function is_last_month($time)
{
    return TimeUtils::is_last_month($time);
}

function is_this_year($time)
{
    return TimeUtils::is_this_year($time);
}

function is_last_year($time)
{
    return TimeUtils::is_last_year($time);
}

/*
获取本周的日期
*/
function get_current_week_first_day()
{
    return TimeUtils::get_current_month_first_day();
}

function get_current_week_days()
{
    return TimeUtils::get_current_week_days();
}

function get_last_week_first_day()
{
    return TimeUtils::get_last_week_first_day();
}

function get_last_week_days()
{
    return TimeUtils::get_last_week_days();
}

function get_next_week_days()
{
    return TimeUtils::get_next_week_days();
}

function get_current_month_first_day()
{
    return TimeUtils::get_current_month_first_day();
}

function get_next_month_first_day($time = "")
{
    return TimeUtils::get_next_month_first_day($time);
}

function get_current_month_days()
{
    return TimeUtils::get_current_month_days();
}

function get_last_month_first_day()
{
    return TimeUtils::get_last_month_first_day();
}

function get_last_month_days()
{
    return TimeUtils::get_last_month_days();
}


function get_last_n_days($n)
{
    return TimeUtils::get_last_n_days($n);
}

/**
 * 获取从某天开始，连续n天的日期
 */
function get_continue_days($first, $next_count, $asc = true)
{
    return TimeUtils::get_continue_days($first, $next_count, $asc);
}

function get_search_days()
{
    return TimeUtils::get_search_days();
}

function get_date_limit($column, $flag)
{
    return SqlMaker::get_date_limit($column, $flag);
}

